package com.itheima.HomeWork.homework02;

import java.util.Comparator;
import java.util.Random;
import java.util.TreeSet;

public class Demo {
    public static void main(String[] args) {
        TreeSet<Integer> integers = new TreeSet<>();
        Random ra = new Random();
        for (int i = 0; i < 10; i++) {
            int num1= ra.nextInt(51);
            integers.add(num1);
        }
        System.out.println(integers);

        TreeSet<Integer>  in= new TreeSet<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        for (int i = 0; i < 10; i++) {
            in.add(ra.nextInt(50,101));
        }
        System.out.println(in);


    }
}
